Learning Flex Basics (Part 1): Creating Your First Flex Application
Table of Contents
- Introduction
- A Brief Overview of Macromedia Flex
- Building the Application
- Create the Application Object
- Add a Panel for the Application Layout
- Add a Label for the View Header
- Add an Array of Objects to Define the Coffee Blends
- Add a ComboBox to Display the Coffee Blends
- Add a Text Control to Display the Description
- Add a Button to Add a Coffee Blend to the Shopping Cart
- Add a List Control for the Shopping Cart
- Add a Script to Handle the Button Click Event
- Complete Code Listing for firstapp.mxml
- Where to Go From Here
Building the Application
In this simplified cart, you will display a list of coffee blends in a ComboBox (similar to an HTML select control). You will use data binding to display a description of the currently selected blend, and a Button with a click handler to add a blend to a List control that represents the shopping cart.
Figure 1. The Flex application you'll build in this tutorial.
In building the calculator you will learn to use:
- The Application class
- The Panel container
- The Script element
- The Array element
- The Object element
- The Label element
- The Text element
- The Button control
- The ComboBox control
- The List control
- An ActionScript function